home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 98
/
098.d81
/
radac demo
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
8KB
|
258 lines
10 poke55,00:poke56,140:clr
20 dn=peek(186):ifdn<8thendn=8
30 goto100
90 poke 214,yy:poke211,xx:print"[145]";:return
95 :
100 sys57812"radac.o",dn,0:poke780,0:poke781,0:poke782,152:sys65493
110 ci=0:rem ci=1, cache fetched: ci=0, no cache fetched
111 sys38912,"p",1,rt:ifrt>10thenl=111:goto9000
115 dim st%(400)
116 sp$=" ":hv$=chr$(255)+chr$(255)+chr$(255)
117 hv$=hv$+hv$:hv$=hv$+hv$:hv$=hv$+hv$+chr$(255)
200 goto 2000
1000 print"any key continues[146]";
1010 poke 198,0:wait198,15:getq$:print"[145]":print" ";
1020 return
1100 :
1102 rem get routine: at$ =display:a1=1=alpha:al=fld len
1103 :
1110 a1$="":a2=0:ifa3<>1 then poke198,0
1115 xx=0:gosub90:gosub1295:poke204,0
1120 poke204,0:wait198,15:get a$
1125 poke204,1
1130 a=asc(a$):if a=20 thengosub1300:goto1195
1132 if a1=1 and a=145 then a2=4:goto1200
1133 if a1=1 and a=17 then a2=5:goto1200
1135 if a=145 or a=175 or a=147 then 1120
1140 if a=13then 1200
1141 if a<32 then 1120
1142 if a=95 then a2=9:goto1200
1144 if a=34 then 1120
1145 if a<91 then 1148
1146 if a<193 or a>218 then 1120
1148 if a1=1 then 1180
1150 if a$="."ora$="," then1180
1160 if a$ = "-" and len(a1$) = 0 then 1180
1170 if a < 48 or a > 60 then 1120
1180 if len(a1$)>al-1 then 1120
1190 a1$=a1$+a$
1195 gosub1295:ifa3<>1then 1120
1196 if len(a1$)=al then return
1197 goto 1120
1200 dv=0:l =len(a1$):a = 0:at = 0:p = 0:an = 1:gosub1295
1205 if a1=1 then return
1210 for i=1 to l:a$ = mid$(a1$,i,1)
1215 if a$="-" then an=-1:goto 1260
1220 ifa$=","then 1260
1230 if a$="."thendv=1:goto 1260
1240 if dv=0 then a=val(a$):at = at*10 + a
1250 if dv=1 then p=p+1:a=val(a$):at = at + a/(10^p)
1260 next:at=at*an:return
1295 print:print "[145]";at$;" ";a1$;" [157][157]";:return
1300 l=len(a1$):ifl=0then return
1310 l=l-1:a1$=mid$(a1$,1,l):return
2000 poke53281,6:poke53280,6:print"",chr$(142)
2010 print "[147] coupon tracker"
2020 print " [163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
2030 print tab(10);"1. fetch"
2032 print tab(10);"2. add "
2034 print tab(10);"3. locate"
2036 print tab(10);"4. list "
2038 print tab(10);"5. purge "
2040 print tab(10);"6. compress"
2042 print tab(10);"7. archive"
2044 print tab(10);"8. quit "
2050 print " enter number":poke198,0
2060 wait198,15:geta$
2070 if a$="1"thengosub3200:goto2000
2075 if a$="2"thengosub2500:goto2000
2080 if a$="3"thengosub3400:goto2000
2085 if a$="4"thengosub4200:goto2000
2090 if a$="5"thengosub4500:goto2000
2093 if a$="6"thengosub5000:goto2000
2095 if a$="7"thengosub3000:goto2000
2097 if a$="8"thengoto2200
2100 goto 2060
2200 print"[147]quit......":if ci then 2210
2201 close15:open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
2202 ifer<>63thenend
2203 poke646,peek(53281):print"[147]load"chr$(34)"hello connect"chr$(34)",8"
2204 print"run"
2205 poke631,13:poke632,13:poke198,2:end
2210 print " cache has data."
2220 print " do you wish to archive? (y/n)":poke198,0
2230 wait198,15:geta$:if a$="n" then end
2240 goto2000
2497 :
2498 :rem add
2499 :
2500 if ci=0 then gosub2700
2510 print"[147] ":print"add new coupon":print"[163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
2520 yy=7:xx=0:gosub90:print "enter:"
2530 a1=1:yy=8:xx=0:gosub90:al=25:at$="name= "
2540 print at$:gosub1100:pn$=a1$:yy=9:gosub90:at$="expiry date (yymmdd)="
2550 a1=0:al=6:printat$:gosub1100:ex=at
2560 yy=11:gosub90:print"for percent enter return"
2570 yy=12:gosub90:at$="amount= ":printat$:gosub1100
2580 if at<>0 then am%=at*100:st%=0:goto2600
2590 at$="[158]percent= ":gosub1100:am%=at+10000:st%=1:print""
2600 i=0
2605 i=i+1:ifst%(i)= 0then2610
2606 if i>400 then 2650
2607 goto2605
2610 st%(i)=1:ct%=int(1000+i)
2620 sys38912,"t",1,"a",pn$,am%,ex,ct%,rt:if rt>10 then l=2620:goto9000
2630 up=1:print chr$(13);"[153] file number is";i;"":gosub1000:return
2640 ifrt<>65thenl=2640:goto9000
2650 print" file full: item not added":gosub1000:return
2700 print"[147] building file!":pn$="":am%=0:ex=0:ct%=0:st%=0
2710 sys38912,"c",1,rt:sys38912,"o",1,"sifi",rt:ifrt>10thenl=2710:goto9000
2720 fori=1 to 400:st%(i)=st%:next
2740 ci=1:return
2997 :
2998 :rem archive
2999 :
3000 print"[147]archive.....":if ci=0 then 3100
3005 close15:open15,8,15,"i0":input#15,e,e$,t,s
3010 yy=8:xx=0:gosub90:a1=1:al= 8
3020 at$=" enter file name:":printat$:gosub1100:if len(a1$)=0 then return
3025 sys38912,"a","2"+ a1$,8,rt
3030 print:i=0:if rt>10 then l=3030:goto9000
3040 sys38912,"c",1,rt:ci=0:sys38912,"o",1,"i",rt:if rt>10thenl=3040:goto9000
3045 i=i+1:if i>400 then 3060
3050 sys38912,"t",1,"a",st%(i),rt:ifrt>10thenl=3050:goto9000
3055 print".";:goto3045
3060 sys38912,"a","1"+ a1$,8,rt:if rt>10 then l=3060:goto9000
3070 sys38912,"c",1,rt:return
3100 print " no cache to archive"
3110 print " request ignored!":gosub1000:return
3197 :
3198 :rem fetch
3199 :
3200 print"[147]fetch....":if ci=1 then 3250
3205 close15:open15,8,15,"i0":input#15,e,e$,t,s
3210 yy=8:xx=0:gosub90:a1=1:al=09:i=0
3220 at$=" enter file name:":printat$:gosub1100:iflen(a1$)=0then return
3225 print: sys38912,"f","1"+ a1$,8,rt:if rt>10 then 3280
3230 o$="f":fori=1to400:sys38912,"t",1,o$,st%(i),rt:ifrt>10thenl=3230:goto9000
3232 print".";
3235 o$="r":next:sys38912,"f","2"+a1$,8,rt:ifrt>10thenl=3235:goto9000
3240 ci=1:return
3250 print " cache has data."
3255 print " do you want to archive?":print " (y/n)":poke198,0
3260 wait198,15:geta$:if a$="n"then3205
3270 return
3280 ifrt<>238thenl=3225:goto9000
3300 print:print "file not found!":gosub1000:return
3387 :
3388 :rem locate
3389 :
3390 print"[147]locate.....":return
3400 gosub3390
3410 if ci=1 then 3440
3420 print" no cache available,":print" request ignored!":gosub1000
3430 return
3440 print " locate by ([158]n)ame or ([158]i)nventory #?":poke 198,0
3450 wait198,15:geta$:ifa$="n"then3610
3460 if a$ <> "i" then 3450
3463 al=3:a1=0:at$="enter number:":yy=8:xx=0:gosub90:printat$:gosub1100
3464 if at>400 or at<1 then print:print"[145]"tab(15);" ":goto3463
3465 n=at:ifst%(n)<>1then 3600
3470 o$="f":ct%=n+1000
3480 sys38912,"s",1," ",pn$," ",am%," ",ex,"=",ct%,rt
3481 ifrt>10then l=3480:goto9000
3500 gosub3390:at$="item found..":print "";at$
3510 print "inventory item no.";n;""
3520 print "product: ";pn$
3530 yy=int(ex/10000):mm=int((ex-yy*10000)/100)
3540 dd=int(ex-(yy*10000)-(mm*100))
3550 if am%>9999then print "value =";am%-10000;"percent":goto3580
3560 p=am%/100+.001:p$=str$(p):p$=left$(p$,len(p$)-1)
3570 print "value = $";p$
3580 print "expiry date: ";mm;"[157]/";dd;"[157]/";yy
3590 gosub4000:return
3600 gosub3390:print" item not available!":gosub1000:return
3610 a1=1:al=25:a1$="":at$="enter product: ":yy=8:xx=0:gosub90:gosub1100
3620 i=0:o$="f":al$=left$(a1$+sp$,25):ah$=left$(a1$+hv$,25):print"[158]":j=0
3630 i=i+1:sys38912,"t",1,o$,pn$,am%,ex,ct%,rt:if rt>10 then3700
3640 o$="r":ifpn$<al$then3630
3645 if ct%>1999 then 3630
3650 if pn$>ah$then 3630
3655 print pn$;:if am%>9999then print tab(27);am%-10000;"%";:goto3670
3660 p=am%/100+.001:p$=str$(p):p$=left$(p$,len(p$)-1):print tab(26);"$";p$;
3670 print tab(35);ct%-1000
3680 j=j+1:ifj>11 then gosub1000:j=0:gosub3390
3690 goto3630
3700 print " end of search!":gosub1000:return
4000 print" ([158]c)ontinue ... ([158]d)elete item":poke198,0
4010 wait 198,15:geta$:if a$="c"then return
4020 if a$<>"d"then 4010
4030 e=ct%-1000:ct%=ct%+1000:sys38912,"t",1,"w",pn$,am%,ex,ct%,rt
4040 if rt>10 thenl=4030:goto9000
4050 st%(e)=2:return
4197 :
4198 :rem list
4199 :
4200 print "[147]list......":if ci=0then4390
4205 print" ([158]a)ctive or ([158]p)urged items":poke 198,0
4210 wait 198,15:geta$:if a$="a" then cl=1000:ch=1500:goto4230
4215 if a$<>"p"then 4210
4220 cl=2000:ch=2999
4230 o$="f":gosub4400
4240 sys38912,"t",1,o$,pn$,am%,ex,ct%,rt:if rt>10 then 4350
4250 o$="r":if ct%<cl or ct%>ch then 4240
4255 yy=int(ex/10000):mm=int((ex-yy*10000)/100)
4256 dd=int(ex-(yy*10000)-(mm*100))
4260 print pn$;tab(34);ct%-cl
4270 print " expiry:";mm;"[157]/";dd;"[157]/";yy;
4280 if am%>9999then print tab(25);a